package com.mew.slots.core.game.szxz;

import com.mew.common.rest.bo.GameSession;
import com.mew.common.util.GameUtil;
import com.mew.common.vo.UserSessionVO;
import com.mew.slots.core.common.handler.AbstractBetHandler;
import com.mew.slots.core.common.handler.SlotsHandler;
import com.mew.slots.core.common.messge.response.SlotsBonusPlayResponseMessage;
import com.mew.slots.core.common.messge.response.SlotsPlayResponseMessage;
import com.mew.slots.core.common.utils.SlotsGameUtil;
import com.mew.slots.core.common.vo.StrategyGameVO;
import com.mew.slots.core.game.szxz.roller.SzxzXml;
import com.mew.slots.core.game.szxz.service.SzxzBonusService;
import com.mew.slots.core.game.szxz.service.SzxzService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @Author King.Song
 * @Date 2020/11/9 0009
 **/
@Service
@SlotsHandler(value = "SZXZ")
@Slf4j
public class SzxzHandler extends AbstractBetHandler {

    private SzxzService service=new SzxzService();
    private SzxzBonusService bonusService=new SzxzBonusService();

    @Override
    public void specialCheck(StrategyGameVO gameVO, GameSession userVO) {}

    @Override
    public SlotsPlayResponseMessage play(StrategyGameVO gameVO, GameSession userVO) {

        return service.Ready(gameVO);
    }

    @Override
    public SlotsBonusPlayResponseMessage playBonus(StrategyGameVO gameVO, GameSession userVO) {
        return bonusService.play(gameVO);
    }

    @Override
    public void readRoller() throws Exception{
        SzxzXml.getInstance().init();
    }

    public static void main(String[] args) throws Exception {
        SzxzHandler handler=new SzxzHandler();
        handler.readRoller();
        StrategyGameVO vo = SlotsGameUtil.buildTestStrategyGameVO();
        vo.setLineNumber(50);
        vo.setControlType(1);
        System.out.println(handler.play(vo,null));
    }
}
